<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateReservationsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('reservations', function (Blueprint $table) {
            $table->increments('id');
            $table->string('city', 50)->comment('城市码');
            $table->integer('play_a')->comment('挑战者');
            $table->integer('play_b')->comment('应战者')->nullable();
            $table->integer('type')->default(1)->comment('类型(1.个人赛，2.团队赛)');
            $table->datetime('game_datetime')->comment('比赛时间');
            $table->string('address', 200)->comment('比赛地点');
            $table->string('contact', 100)->comment('联系方式')->nullable();
            $table->string('desc', 200)->comment('补充说明')->nullable();
            $table->integer('abnormal_id')->comment('投诉人')->nullable();
            $table->string('abnormal_address', 1000)->comment('投诉地点')->nullable();
            $table->integer('status')->default(10)->comment('状态(10.挑战，20.应战，30拒绝，40.投诉，50.完结)');
            $table->integer('view')->default(0)->comment('查看次数');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('reservations');
    }
}
